#ifndef GPXMANAGER_H
#define GPXMANAGER_H

#include <QtXml>
#include <QObject>
#include <QFile>
#include "map.h"
#include "point.h"
#include "route.h"
#include "track.h"

class GpxManager
{
private:
    QString name;
    QDomElement point2gpx(QDomDocument *doc, Point point);
    QDomElement route2gpx(QDomDocument *doc, Route route);
    QDomElement track2gpx(QDomDocument *doc, Track track);
    QDomElement map2gpx(QDomDocument *doc, Map map);
    QDomElement createTextElement(QDomDocument *doc, QString name, QString value);
public:
    GpxManager();
    ~GpxManager();
    void write(QList <Point> points, QList <Route> routes, QList <Track> tracks, QList<Map> maps);
    void read(QList <Point> &points, QList<Map> &maps);
};

#endif // GPXMANAGER_H
